﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class StartSceneState : ISceneState
{
    public StartSceneState(SceneController sceneController) : base(sceneController, "01StartScene")
    {
    }
    private Image logo;
    private float colorLerpSpeed = 0.8f;
    private float existTime = 4f;
    public override void StateEnd()
    {
        base.StateEnd();
    }
    public override void StateStart()
    {
        //Initialize logo
        logo = GameObject.Find("Logo").GetComponent<Image>();
        //set image color with black
        logo.color = Color.black;
    }
    public override void StateUpdate()
    {
        //base.StateUpdate();
        //Debug.Log("!!!");
        logo.color = Color.Lerp(logo.color, Color.white, Time.deltaTime*colorLerpSpeed);
        existTime -= Time.deltaTime;
        if (existTime <= 0)
        {
            m_sceneController.SetState(new MainMenuSceneState(m_sceneController));
        }
    }
}
